<template>
  <div class="EmergencyList">
    <div class="flex location-wrap">
      <span class="white">当前位置：</span>
      <el-breadcrumb separator="/">
        <el-breadcrumb-item :to="{ path: '/TrainingPlan' }">培训演练</el-breadcrumb-item>
        <el-breadcrumb-item>演练计划</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="box">
      <!-- 列表筛选 -->
      <filterTitle @query="query" @reset="reset" :form="form" :formData="config.formData" @node-click="handleSelectTree"
        @change="selectChange">
      </filterTitle>
      <!-- 列表表格 -->
      <LsdTable slot="yjrwlb" :paginationAtrrs="config.table.paginationAtrrs" @pageChange="handleSizeChange"
        :compRef="config.table.compRef" ref="yjrwlb" :columns="config.table.columns" :title="config.table.title"
        :actions="config.table.actions" :tableData="config.table.tableData" :tableAttr="config.table.tableAttr"
        :isShowPage="config.table.isShowPage" :isSelectFlag="config.table.isSelectFlag"
        :isSequenceFlag="config.table.isSequenceFlag" @onActionClick="onActionClick" />
    </div>
    <!-- 年度演练计划 -->
    <LsdDialog v-if="$route.query.type === 'yearsPlan' && config.dialogConfig.isShow === true" @handleBtn="onActionClick"
      :dialogConfig="config.dialogConfig" @close="close(config.dialogConfig)">
      <LsdDialogTitle slot="dialog" :titleConfig="config.titleConfig" :activeNames="config.activeNames">
        <div slot="slot1" class="uploadBox">
          <LsdTable :autoHeight="config.yearsImportConfig.table.autoHeight"
            :compRef="config.yearsImportConfig.table.compRef" ref="xzdw" :columns="config.yearsImportConfig.table.columns"
            :title="config.yearsImportConfig.table.title" :actions="config.yearsImportConfig.table.actions"
            :tableData="config.yearsImportConfig.table.tableData" :tableAttr="config.yearsImportConfig.table.tableAttr"
            :isShowPage="config.yearsImportConfig.table.isShowPage"
            :isSelectFlag="config.yearsImportConfig.table.isSelectFlag"
            :isSequenceFlag="config.yearsImportConfig.table.isSequenceFlag" @onActionClick="onActionClick" />
          <DialogForm style="margin-top:20px" ref="formComponent" @handlePreview="handlePreview"
            @handleRemove="(file, fileList) => { handleRemove(file, fileList, 'formComponent'); }"
            @handleBeforeUpload="((file) => { handleBeforeUpload(file, 1); })"
            :formConfig="config.yearsImportConfig.formConfig">
            <div slot="upload" class="upload">
              <div class="upload uploadStyle" @click.prevent.stop="noPrevent">
                <el-input class="sjgy" v-model="fileListName"></el-input>
              </div>
              <el-button slot="trigger" type="primary">导入</el-button>
              <el-button @click.stop="() => { download(); }">模板下载</el-button>
              <el-button @click.stop="() => { clear('formComponent'); }">清除</el-button>
            </div>
          </DialogForm>
          <DialogForm ref="formComponent1" @handlePreview="handlePreview"
            @handleRemove="(file, fileList) => { handleRemove(file, fileList, 'formComponent1'); }"
            @handleBeforeUpload="((file) => { handleBeforeUpload(file, 2); })"
            :formConfig="config.yearsImportConfig.formConfig1">
            <div slot="upload1" class="upload">
              <div class="upload uploadStyle" @click.prevent.stop="noPrevent">
                <el-input class="sjgy" v-model="fileListName1"></el-input>
              </div>
              <el-button type="primary">导入</el-button>
              <el-button @click.stop="clear('formComponent1')">清除</el-button>
            </div>
          </DialogForm>
        </div>
        <DialogForm ref="formComponent2" slot="slot2" :formConfig="config.yearsImportConfig.formConfig2" />
      </LsdDialogTitle>
    </LsdDialog>
    <!-- 月度演练计划编辑、审批 -->
    <LsdDialog v-if="['monthPlan', 'temporaryPlan'].includes($route.query.type)" @handleBtn="onActionClick"
      :dialogConfig="config.monthConfig.dialogConfig" @close="close(config.monthConfig.dialogConfig)">
      <LsdDialogTitle slot="dialog" :titleConfig="config.monthConfig.titleConfig"
        :activeNames="config.monthConfig.activeNames">
        <DialogForm ref="formComponent" slot="slot1" :formConfig="config.monthConfig.formConfig" />
        <DialogForm @treeInput="treeInput" ref="formComponent1" slot="slot2"
          :formConfig="config.monthConfig.formConfig1" />
        <DialogForm ref="formComponent2" slot="slot3" :formConfig="config.monthConfig.formConfig2" />
        <DialogForm ref="formComponent3" slot="slot4" :formConfig="config.monthConfig.formConfig3" />
      </LsdDialogTitle>
    </LsdDialog>
    <!-- 下发通知弹窗 -->
    <LsdDialog v-if="['monthPlan', 'temporaryPlan'].includes($route.query.type)" @handleBtn="onActionClick"
      :dialogConfig="config.issueConfig.dialogConfig" @close="close(config.issueConfig.dialogConfig)">
      <LsdDialogTitle slot="dialog" :titleConfig="config.issueConfig.titleConfig"
        :activeNames="config.issueConfig.activeNames">
        <DialogForm ref="formComponent" slot="slot1" :formConfig="config.issueConfig.formConfig" />
        <DialogForm ref="formComponent1" slot="slot2" @handlePreview="handlePreview"
          @handleRemove="(file, fileList) => { handleRemove(file, fileList, 'formComponent1'); }"
          @handleBeforeUpload="((file) => { handleBeforeUpload(file, 3); })" :formConfig="config.issueConfig.formConfig1">
          <div slot="upload" class="upload underLine">
            <el-input v-show="config.issueConfig.dialogConfig.type === 'edit'" class="sjgy" v-model="fileListName2"
              placeholder="上传"></el-input>
            <div v-show="config.issueConfig.dialogConfig.type === 'audit'">{{ fileListName2 }}</div>
          </div>
        </DialogForm>
        <div v-for="(item, index) in cydwList" slot="slot3" :key="index">
          <DialogForm :ref="item.ref" :formConfig="item.formConfig" />
        </div>
        <DialogForm ref="tbxx" slot="slot4" :formConfig="config.issueConfig.tbxxFormConfig" />
        <DialogForm ref="shxx" slot="slot5" :formConfig="config.issueConfig.shxxFormConfig" />
      </LsdDialogTitle>
    </LsdDialog>
    <!-- 人员上报弹窗 -->
    <LsdDialog v-if="['monthPlan', 'temporaryPlan'].includes($route.query.type)" @handleBtn="onActionClick"
      :dialogConfig="config.personnelConfig.dialogConfig" @close="close(config.personnelConfig.dialogConfig)">
      <LsdDialogTitle slot="dialog" :titleConfig="config.personnelConfig.titleConfig"
        :activeNames="config.personnelConfig.activeNames">
        <DialogForm ref="formComponent" slot="slot1" :formConfig="config.personnelConfig.formConfig" />
        <DialogForm ref="formComponent1" slot="slot2" :formConfig="config.personnelConfig.formConfig1" />
        <div slot="slot3">
          <DialogForm v-if="config.personnelConfig.table.tableData.length === 0" ref="formComponent2"
            @getResourcesData="getResourcesData" :formConfig="config.personnelConfig.formConfig2" />
          <div v-if="config.personnelConfig.table.tableData.length > 0"
            style="font-size:16px;margin-left:30px;color: #606266;">已选人员：{{ config.personnelConfig.table.tableData.length
            }}
          </div>
          <LsdTable v-if="config.personnelConfig.table.tableData.length > 0"
            :tableData="config.personnelConfig.table.tableData" :autoHeight="config.personnelConfig.table.autoHeight"
            :columns="config.personnelConfig.table.columns" :compRef="config.personnelConfig.table.compRef"
            :accesskey="config.personnelConfig.table.compRef" :title="config.personnelConfig.table.title"
            :actions="config.personnelConfig.table.actions" :tableAttr="config.personnelConfig.table.tableAttr"
            :isShowPage="config.personnelConfig.table.isShowPage"
            :isSelectFlag="config.personnelConfig.table.isSelectFlag"
            :isSequenceFlag="config.personnelConfig.table.isSequenceFlag" @onActionClick="onActionClick" />
        </div>
        <DialogForm ref="formComponent3" slot="slot4" :formConfig="config.personnelConfig.formConfig3" />
        <DialogForm ref="formComponent4" slot="slot5" :formConfig="config.personnelConfig.formConfig4" />
      </LsdDialogTitle>
    </LsdDialog>
    <!-- 人员选择弹窗 -->
    <DialogChoose v-if="['monthPlan', 'temporaryPlan'].includes($route.query.type)" ref="dialogChoose"
      @checkSelect="checkSelect" @handleChooseChange="handleChooseChange" @chooseQuery="chooseQuery"
      :ChooseConfig="config.ChooseConfig" @close="close" @teamAdd="teamAdd" :ChooseFormConfig="config.PersonnelFormConfig"
      :ChooseTableConfig="config.PersonnelTableConfig"></DialogChoose>
    <div class="chooseMember">
      <DialogChoose :autoHeight="config.PersonnelTableConfig1.autoHeight"
        v-if="['monthPlan', 'temporaryPlan'].includes($route.query.type)" ref="dialogChoose1" @chooseQuery="chooseQuery"
        :ChooseConfig="config.ChooseConfig1" @close="close" :ChooseTableConfig="config.PersonnelTableConfig1">
      </DialogChoose>
    </div>
    <!-- 临时演练计划新增、审核 -->
    <div class="temporaryPlan">
      <LsdDialog v-if="$route.query.type === 'temporaryPlan'" @handleBtn="onActionClick"
        :dialogConfig="config.temporaryDrillAddConfig.dialogConfig"
        @close="closeTemporary(config.temporaryDrillAddConfig.dialogConfig)">
        <LsdDialogTitle slot="dialog" :titleConfig="config.temporaryDrillAddConfig.titleConfig"
          :activeNames="config.temporaryDrillAddConfig.activeNames">
          <DialogForm ref="formComponent" @treeInput="treeInput" slot="slot1"
            :formConfig="config.temporaryDrillAddConfig.formConfig" />
          <DialogForm ref="formComponent1" slot="slot2" :formConfig="config.temporaryDrillAddConfig.formConfig1" />
          <DialogForm ref="formComponent2" slot="slot3" :formConfig="config.temporaryDrillAddConfig.formConfig2" />
        </LsdDialogTitle>
      </LsdDialog>
    </div>
    <!--关联年计划 -->
    <LsdDialog :dialogConfig="dialogConfig3" @handleBtn="handleBtn" @close="close4">
      <LsdDialogTitle slot="dialog" :titleConfig="titleConfig3" :activeNames="activeNames3">
        <DialogForm ref="formComponent10" slot="slot1" :formConfig="formConfig10" />
        <div slot="slot1">
          <div class="Download">
            附件：
          </div>
          <div class="Downloads" @click="handlePreviews(attachInfo)">
            {{ attachInfo.attach_name }}
          </div>
        </div>
      </LsdDialogTitle>
    </LsdDialog>
  </div>
</template>

<script>
import { handleGetNextUsers } from "@/utils/flow";
import { showTime } from "@/lib";
// import { omit } from "lodash";
import common from "@/utils/common.js";
import { getUnitTreeApi } from "@/api/EarlyWarningManagement/yjrb";
import { getAccountByOrg } from "@/api/SystemConfig/organization.js";
import { getMemberss } from "@/api/TrainingAndExercise/ydpxjh.js";
import { UploadFile, loadFile, getDictByGroup, dicList, getOrgDepartmentList } from "@/api/common.js";// GetOrgTree,
import {
  upload,
  // GetTeamMember,
  TemplateDownload,
  // getListUser,
  getYearList,
  yearsPlanListPage,
  getActuMembers,
  yearSubmit,
  monthPlanListPage,
  getMonthById,
  monthPlanDetailSave,
  monthPlanDetailSubmit,
  monthPlanDetailApprove,
  getMonthXfDetail,
  monthPlanXfSave,
  monthPlanXfSubmit,
  monthPlanXfApprove,
  monthExport,
  ryxzDetail,
  ryxzSave,
  ryxzSbumit,
  ryxzApproval,
  // temporaryPlanListPage,
  // getLsDetail,
  // lsSave,
  // lsSubmit,
  // lsApproval,
  // selectQueryParam,
  monthPlanXfUpdate
} from "@/api/TrainingAndExercise/DrillPlan/index.js";
export default {
  data() {
    return {
      form: {},
      config: {},
      rules: [],
      fileListName: "",
      fileListName1: "",
      fileListName2: "",
      userDep: sessionStorage.getItem("dwbmName"),
      userDepId: JSON.parse(sessionStorage.getItem("org")).orgId,
      userName: JSON.parse(sessionStorage.getItem("account")).realName,
      time: showTime(new Date()),
      id: "",
      drillNoticeId: "",
      // 下发通知参演单位数组
      cydwList: [],
      organisedUnitName: "", // 模板主办单位
      // 关联年计划弹窗信息
      dialogConfig3: {
        title: "关联年计划",
        isShow: false, // 弹窗显示隐藏
        btnList: [
          {
            id: "returnFalse",
            name: "返回",
            type: "primary",
            size: "mini"
          }
        ]
      },
      activeNames3: ["1"], // 关联年计划折叠面板默认展开列
      // 关联年计划
      titleConfig3: [
        {
          title: "年度培训信息",
          name: "1",
          slot: "slot1"
        }
      ],
      formConfig10: {
        formData: [
          {
            type: "input",
            label: "演练项目",
            prop: "drillProjectName",
            class: "half",
            lableWidth: "140px",
            isDisabled: true
          },
          {
            type: "input",
            label: "主办单位",
            prop: "organisedUnitName",
            class: "half",
            lableWidth: "140px",
            isDisabled: true
          },
          {
            type: "input",
            label: "演练事件类别",
            prop: "drillCategory",
            class: "half",
            lableWidth: "140px",
            isDisabled: true
          },
          {
            type: "input",
            label: "计划完成时间",
            prop: "planCompleteTime",
            class: "half",
            lableWidth: "140px",
            isDisabled: true
          },
          {
            type: "input",
            label: "参演单位",
            prop: "drillUnit",
            class: "half",
            lableWidth: "140px",
            isDisabled: true
          }
        ]
      },
      attachInfo: {}
    };
  },
  watch: {
    "$route.query.type": {
      handler(val) {
        this.config = require(`./config/${val}`).default.config(this);
        this.getList();
        this.form = {};
      },
      deep: true
    },
    "config.dialogConfig.isShow": {
      handler(val) {
        if (val) {
          this.$nextTick(() => {
            this.$set(this.$refs.formComponent1.form, "fillUser", this.userName);
            this.$set(this.$refs.formComponent1.form, "fillUserDept", this.userDep);
            this.$set(this.$refs.formComponent1.form, "fillTime", this.time);
          });
        }
      },
      deep: true
    }
  },
  created() {
    const type = this.$route.query.type ?? "yearsPlan";
    this.config = require(`./config/${type}`).default.config(this);
  },
  mounted() {
    this.getList();
    this.getSerchData();
  },
  methods: {
    // 弹窗按钮点击事件 对应id绑定事件
    handleBtn(item) {
      this[item.id]();
    },
    // 弹窗关闭图标
    close4() {
      this.dialogConfig3.isShow = false;
    },
    returnFalse() {
      this.close4();
    },
    // 关联年度计划弹窗
    associatedDrillName(id) {
      this.dialogConfig3.isShow = true;
      getMonthById({ id: id }).then(res => {
        this.$refs.formComponent10.form = res.yearlyDetailVo;
        this.attachInfo = JSON.parse(res.attachInfo);
      });
    },
    // 获取列表筛选字典数据
    getSerchData() {
      this.config.formData.forEach((item) => {
        if (item.dic) {
          getDictByGroup({ groupCode: item.dic }).then((res) => {
            const option = res.map((item) => {
              return {
                label: item.dicName,
                value: item.dicCode
              };
            });
            item.options = option;
          });
        } else if (item.dics) {
          dicList({ code: item.dics }).then(res => {
            const option = res.map((item) => {
              return {
                label: item.dicName,
                value: item.id
              };
            });
            item.options = option;
          });
        }
      });
      getUnitTreeApi().then(res => {
        if (this.$route.query.type === "yearsPlan") {
          this.config.formData[0].treeData.attrs.data = res;
          this.config.formData[3].treeData.attrs.data = res;
        } else {
          this.config.formData[0].treeData.attrs.data = res;
          this.config.formData[3].treeData.attrs.data = res;
        }
      });
    },
    // 列表查询树结构点击事件
    handleSelectTree(arg, item) {
      const type = this.$route.query.type;
      if (type === "yearsPlan") {
        if (item.label === "主办单位") {
          this.$set(this.form, "organisedUnitName", arg[0].orgName);
          // this.$set(this.form, "organisedUnitId", arg[0].id);
        } else if (item.label === "参演单位") {
          this.$set(this.form, "drillUnit", arg[0].orgName);
          // this.$set(this.form, "drillUnitIds", arg[0].id);
        }
      } else {
        if (item.label === "主办单位") {
          this.$set(this.form, "organisedUnitName", arg[0].orgName);
          // this.$set(this.form, "organisedUnitId", arg[0].id);
        } else if (item.label === "参演单位") {
          this.$set(this.form, "drillUnit", arg[0].orgName);
          // this.$set(this.form, "drillUnitIds", arg[0].id);
        }
      }
    },
    // 单位选择选择人数
    treeInput(value, data, node) {
      if (this.config.monthConfig.dialogConfig.isShow === true) {
        data.porgName = value;
        const result = this.$refs.formComponent1.form.drillUnitIds;
        const result1 = this.$refs.formComponent1.form.drillUnit;
        if (result.length > 0) {
          if (result.indexOf(data.id) === -1) {
            this.$refs.formComponent1.form.drillUnit.push(`${data.orgName}(${data.porgName})`);
            this.$refs.formComponent1.form.drillUnitIds.push(data.id);
          } else {
            const toBeDeleted = []; // 需要删除的下标记录
            result.forEach((item, index) => {
              if (item === data.id) {
                console.log(value);
                if (!value) {
                  toBeDeleted.push(index); // 记录需要删除的下标
                } else {
                  result1[index] = `${data.orgName}(${data.porgName})`;
                  this.$set(this.$refs.formComponent1.form, "drillUnitIds", result);
                  this.$set(this.$refs.formComponent1.form.drillUnit, index, `${data.orgName}(${data.porgName})`);
                }
              }
            });
            // 遍历完成后进行删除操作
            if (toBeDeleted.length > 0) {
              this.$nextTick(() => {
                toBeDeleted.reverse().forEach((index) => { // 从后向前删除，避免下标变化导致的错误
                  result.splice(index, 1);
                  result1.splice(index, 1);
                });
                this.$set(this.$refs.formComponent1.form, "drillUnitIds", result);
                this.$set(this.$refs.formComponent1.form, "drillUnit", result1);
              });
            }
          }
        } else {
          this.$refs.formComponent1.form.drillUnit.push(`${data.orgName}(${data.porgName})`);
          this.$refs.formComponent1.form.drillUnitIds.push(data.id);
        }
      } else if (this.config.temporaryDrillAddConfig.dialogConfig.isShow === true) {
        data.porgName = value;
        const result = this.$refs.formComponent.form.drillUnitIds;
        const result1 = this.$refs.formComponent.form.drillUnit;
        if (result.length > 0) {
          if (result.indexOf(data.id) === -1) {
            this.$refs.formComponent.form.drillUnit.push(`${data.orgName}(${data.porgName})`);
            this.$refs.formComponent.form.drillUnitIds.push(data.id);
          } else {
            const toBeDeleted = []; // 需要删除的下标记录
            result.forEach((item, index) => {
              if (item === data.id) {
                console.log(value);
                if (!value) {
                  toBeDeleted.push(index); // 记录需要删除的下标
                } else {
                  result1[index] = `${data.orgName}(${data.porgName})`;
                  this.$set(this.$refs.formComponent.form, "drillUnitIds", result);
                  this.$set(this.$refs.formComponent.form.drillUnit, index, `${data.orgName}(${data.porgName})`);
                }
              }
            });
            // 遍历完成后进行删除操作
            if (toBeDeleted.length > 0) {
              this.$nextTick(() => {
                toBeDeleted.reverse().forEach((index) => { // 从后向前删除，避免下标变化导致的错误
                  result.splice(index, 1);
                  result1.splice(index, 1);
                });
                this.$set(this.$refs.formComponent.form, "drillUnitIds", result);
                this.$set(this.$refs.formComponent.form, "drillUnit", result1);
              });
            }
          }
        } else {
          this.$refs.formComponent.form.drillUnit.push(`${data.orgName}(${data.porgName})`);
          this.$refs.formComponent.form.drillUnitIds.push(data.id);
        }
      }
    },
    // 树状点击事件
    handleNodeClick(data, node, item) {
      if (item.label === "主办单位") {
        if (!data.children) {
          this.$set(this.$refs.formComponent.form, "organisedUnitName", data.orgName);
          this.$set(this.$refs.formComponent.form, "organisedUnitId", data.id);
        }
      }
    },
    selectChange(arg, item) {
      if (this.$route.query.type === "yearsPlan") {
        if (item.label === "演练事件类别") {
          this.form.drillCategory = arg[0];
        }
      }
    },
    // 平铺树结构
    flatTreeArr(arr) {
      return arr.reduce((acc, cur) => {
        if (Array.isArray(cur.children)) {
          const copyCur = { ...cur };
          delete copyCur.children;
          return acc.concat(copyCur, this.flatTreeArr(cur.children));
        } else {
          return acc.concat(cur);
        }
      }, []);
    },
    noPrevent() {
      console.log(123);
    },
    // 文件清除
    clear(val) {
      this.$refs[val].fileList = [];
      if (val === "formComponent") {
        this.fileListName = "";
        this.config.yearsImportConfig.table.tableData = [];
      } else {
        this.fileListName1 = "";
      }
    },
    // 文件上传
    handleBeforeUpload(file, val) {
      const parmas = {
        file: file
      };
      // const parmas1 = {
      //   file: file,
      //   directoryId: 0,
      //   isNew: true,
      //   moduleName: "EmergencyEvent"
      // };
      if (val === 1) {
        upload(this.common.convertFormData(parmas)).then(data => {
          this.organisedUnitName = data[0].organisedUnitName;
          console.log(data, "年度模板导入");
          this.$nextTick(() => {
            this.config.yearsImportConfig.table.tableData = data;
          });
        });
      }
      UploadFile(this.common.convertFormData(parmas)).then(data => {
        this.$nextTick(() => {
          if (val === 1) {
            this.fileListName = data.fileName;
            this.$refs.formComponent.fileList.push({ name: data.fileName, attachId: data.id });
          } else if (val === 2) {
            this.fileListName1 = data.fileName;
            this.$refs.formComponent1.fileList.push({ name: data.fileName, attachId: data.id });
          } else if (val === 3) {
            this.fileListName2 = data.fileName;
            this.$refs.formComponent1.fileList.push({ name: data.fileName, attachId: data.id });
          }
        });
      });
    },
    // 模板下载
    download() {
      TemplateDownload().then(res => {
        common.downloadByBlob(res, `演练计划模板${new Date().getTime()}.xls`);
      });
    },
    // 导出
    export() {
      const parmas = {
        pageNum: this.config.table.paginationAtrrs["current-page"],
        pageSize: this.config.table.paginationAtrrs["page-size"]
      };
      monthExport(parmas).then(res => {
        common.downloadByBlob(res, `月度演练计划列表.xls`);
      });
    },
    handleRemove(file, fileList, ref) {
      this.$set(this.$refs[ref], "fileList", fileList);
      this.fileListName2 = "";
    },
    // 下载
    handlePreview(item) {
      const datas = JSON.parse(item);
      loadFile({ id: datas.attach_id }).then(data => {
        window.open(data);
      });
    },
    // 下载年计划详情
    handlePreviews(item) {
      loadFile({ id: item.attach_id }).then(data => {
        window.open(data);
      });
    },
    checkUpload(val) {
      this.$nextTick(() => {
        return this.$refs[val].fileList[0].name;
      });
    },
    query() {
      // let form = this.form;
      // if (form.jhwcsj) {
      // form.planCompleteTimeStart = form.jhwcsj[0];
      // form.planCompleteTimeEnd = form.jhwcsj[1];
      // form = omit(form, ["jhwcsj"]);
      // }
      const parmas = {
        pageNum: 1,
        pageSize: 10,
        orgId: JSON.parse(sessionStorage.getItem("org")).orgId,
        ...this.form
      };
      this.getList(parmas);
    },
    reset() {
      this.form = {};
      this.getList();
    },
    // dic获取下拉数据
    getInputVal() {
      this.config.monthConfig.formConfig1.formData.forEach((item) => {
        if (item.dic) {
          getDictByGroup({ groupCode: item.dic }).then((res) => {
            const option = res.map((item) => {
              return {
                label: item.dicName,
                value: item.dicCode
              };
            });
            item.option = option;
          });
        } else if (item.dics) {
          dicList({ code: item.dics }).then(res => {
            const option = res.map((item) => {
              return {
                label: item.dicName,
                value: item.id
              };
            });
            item.option = option;
          });
        }
      });
      this.config.temporaryDrillAddConfig.formConfig.formData.forEach((item) => {
        if (item.dic) {
          getDictByGroup({ groupCode: item.dic }).then((res) => {
            const option = res.map((item) => {
              return {
                label: item.dicName,
                value: item.dicCode
              };
            });
            item.option = option;
          });
        } else if (item.prop === "associatedDrillId") { // 关联年计划
          getYearList().then(res => {
            const option = res.map((item) => {
              return {
                label: item.drillProjectName,
                value: item.id
              };
            });
            item.option = option;
          });
        } else if (item.dics) {
          dicList({ code: item.dics }).then(res => {
            const option = res.map((item) => {
              return {
                label: item.dicName,
                value: item.id
              };
            });
            item.option = option;
          });
        }
      });
      const orgId = JSON.parse(sessionStorage.getItem("org")).orgId;
      getOrgDepartmentList({ orgId }).then(res => {
        this.config.monthConfig.formConfig1.formData[4].treeData.data = res;
        this.config.temporaryDrillAddConfig.formConfig.formData[1].treeData.data = res;
        this.config.temporaryDrillAddConfig.formConfig.formData[6].treeData.data = res;
      });
    },
    getUser() {
      const parmas = {
        orgId: JSON.parse(sessionStorage.getItem("org")).orgId
      };
      getAccountByOrg(this.common.convertFormData(parmas)).then(res => {
        const option = res.map((item) => {
          return {
            label: `${item.realName}(${item.phone})`,
            value: item.userId
          };
        });
        this.config.issueConfig.formConfig1.formData[4].option = option;
      });
    },
    // 年度、月度、临时演练计划列表
    getList(val) {
      let parmas = {
        pageNum: 1,
        pageSize: 10,
        orgId: JSON.parse(sessionStorage.getItem("org")).orgId
      };
      if (val) {
        parmas = val;
      }
      const type = this.$route.query.type;
      const apiName = {
        yearsPlan: yearsPlanListPage,
        monthPlan: monthPlanListPage,
        temporaryPlan: monthPlanListPage
        // temporaryPlan: temporaryPlanListPage
      };
      if (type === "monthPlan") {
        parmas.dataType = 1;
      } else if (type === "temporaryPlan") {
        parmas.dataType = 2;
      }
      apiName[type](parmas).then(res => {
        const tableData = res.data;
        if (tableData.length > 0) {
          tableData.map(i => {
            if (i.drillUnit !== "" && i.drillUnit !== undefined && i.drillUnit !== null) {
              i.drillUnit = (i.drillUnit).replace(/,/g, "、");
            }
          });
        }
        this.config.table.paginationAtrrs.total = res.total;
        this.config.table.tableData = tableData;
      });
    },
    // 查看参演人员
    async getActualDrillCount(id) {
      this.chooseId = id;
      this.config.ChooseConfig1.isShow = true;
      const res = await getActuMembers({ drillId: id });
      this.config.PersonnelTableConfig1.tableData = res;
    },
    async getchooseMember(id, val) {
      const parmas = {
        drillId: id,
        ...val
      };
      const res = await getActuMembers(parmas);
      this.config.PersonnelTableConfig1.tableData = res;
    },
    // 年度导入
    yearsImport() {
      this.config.dialogConfig.isShow = true;
      this.$nextTick(() => {
        this.$set(this.$refs.formComponent2.form, "fillUser", this.userName);
        this.$set(this.$refs.formComponent2.form, "fillUserDept", this.userDep);
        this.$set(this.$refs.formComponent2.form, "fillTime", this.time);
        this.$set(this.config.yearsImportConfig.table, "tableData", []);
        this.$set(this.$refs.formComponent, "fileList", []);
        this.$set(this.$refs.formComponent1, "fileList", []);
      });
    },
    // 年度导入提交
    yearImportSubmit() {
      let attachInfo = {};
      let attachInfo1 = {};
      let flag = false;
      if (this.$refs.formComponent.fileList.length > 0) {
        attachInfo = {
          attach_name: this.$refs.formComponent.fileList[0].name,
          attach_id: this.$refs.formComponent.fileList[0].attachId
        };
        flag = true;
      } else {
        flag = false;
        this.$message.error("请先导入年度演练计划！");
      }
      if (this.$refs.formComponent1.fileList.length > 0) {
        attachInfo1 = {
          attach_name: this.$refs.formComponent1.fileList[0].name,
          attach_id: this.$refs.formComponent1.fileList[0].attachId
        };
      }
      if (flag) {
        const tableData = this.config.yearsImportConfig.table.tableData;
        tableData.map(i => {
          i.organisedUnitName = this.organisedUnitName;
          i.organisedUnitId = "";
        });
        const parmas = {
          creator: this.userName,
          creatorUnit: this.userDep,
          createTime: this.time,
          drillYearlyList: tableData,
          attachInfo: JSON.stringify(attachInfo),
          attachInfo1: JSON.stringify(attachInfo1)
        };
        yearSubmit(parmas).then(res => {
          if (res) {
            this.$message({
              message: "提交成功！",
              type: "success"
            });
            this.config.dialogConfig.isShow = false;
            this.getList();
          }
        });
      }
    },
    // 月度、临时演练计划编辑
    edit(scope) {
      console.log(scope.row.id);
      this.id = scope.row.id;
      this.config.monthConfig.dialogConfig.isShow = true;
      this.config.monthConfig.dialogConfig.type = "edit";
      this.getMonthPlanDetail(scope.row.id);
      this.getInputVal();
    },
    // 月度、临时演练计划编辑详情
    getMonthPlanDetail(val) {
      const parmas = {
        id: val
      };
      getMonthById(parmas).then(res => {
        const form = res.drillMonthlySubDetailVo;
        if (this.config.monthConfig.dialogConfig.type === "edit") {
          if (res.drillMonthlySubDetailVo) {
            // console.log(form, "????form");
            form.drillUnitIds = form.drillUnitIds !== null && form.drillUnitIds !== "" && form.drillUnitIds !== undefined ? (form.drillUnitIds).split(",") : [];
            form.drillUnit = form.drillUnit !== null && form.drillUnit !== "" && form.drillUnit !== undefined ? (form.drillUnit).split(",") : [];
          }
        }
        form.drillProjectName = res.drillMonthlySubDetailVo ? res.drillMonthlySubDetailVo.drillProjectName : res.yearlyDetailVo.drillProjectName;
        this.$refs.formComponent.form = res.yearlyDetailVo;
        this.$refs.formComponent1.form = form;
        this.$set(this.$refs.formComponent2.form, "fillUser", res.fillUser || this.userName);
        this.$set(this.$refs.formComponent2.form, "fillUserDept", res.fillUserDept || this.userDep);
        this.$set(this.$refs.formComponent2.form, "fillTime", res.fillTime || this.time);
        console.log(this.$refs.formComponent2.form, "???this.$refs.formComponent2.form");
      });
    },
    // 保存
    async save(type) {
      const flowObj = {
        bizKey: this.id,
        flowKey: "drill_plan_001",
        taskId: "task1",
        idea: "1",
        ideaMsg: ""
      };
      if (this.config.monthConfig.dialogConfig.isShow === true) {
        this.$refs.formComponent1.isValidate();
        const flag = this.$refs.formComponent1.flag;
        if (flag) {
          const form = this.$refs.formComponent1.form;
          form.drillUnitIds = form.drillUnitIds instanceof Array ? (form.drillUnitIds).join(",") : form.drillUnitIds;
          form.drillUnit = form.drillUnit instanceof Array ? (form.drillUnit).join(",") : form.drillUnit;
          let parmas = {
            ...form,
            fillUser: this.userName,
            fillUserDept: this.userDep,
            fillTime: this.time,
            dataType: 1,
            // organisedUnitId: this.userDepId,
            // organisedUnitName: this.userDep,
            id: this.id
          };
          if (!type) {
            monthPlanDetailSave(parmas).then(res => {
              if (res) {
                this.$message({
                  message: "保存成功！",
                  type: "success"
                });
                this.config.monthConfig.dialogConfig.isShow = false;
                this.getList();
              }
            });
          } else if (type === "submit") {
            flowObj.taskId = "task1";
            flowObj.idea = "1";
            flowObj.ideaMsg = "";
            const nextAssigneeList = await handleGetNextUsers(flowObj);
            parmas = { ...parmas, ...flowObj, nextAssigneeList };
            monthPlanDetailSubmit(parmas).then(res => {
              if (res) {
                this.$message({
                  message: "提交成功！",
                  type: "success"
                });
                this.config.monthConfig.dialogConfig.isShow = false;
                this.getList();
              }
            });
          } else if (["agree", "reject"].includes(type)) {
            if (type === "agree") {
              parmas.approvalSign = "pass";
              flowObj.idea = "1";
              flowObj.ideaMsg = "同意";
            } else if (type === "reject") {
              parmas.approvalSign = "reject";
              flowObj.idea = "0";
              flowObj.ideaMsg = "驳回";
            }
            flowObj.taskId = "task2";
            const nextAssigneeList = await handleGetNextUsers(flowObj);
            parmas.approvalOpinion = this.$refs.formComponent3.form.approvalOpinion;
            parmas.approver = this.userName;
            parmas.approvalUnit = this.userDep;
            parmas.approvalTime = this.time;
            parmas = { ...parmas, ...flowObj, nextAssigneeList };
            monthPlanDetailApprove(parmas).then(res => {
              if (res) {
                this.$message({
                  message: "审核成功！",
                  type: "success"
                });
                this.config.monthConfig.dialogConfig.isShow = false;
                this.getList();
              }
            });
          }
        }
      } else if (this.config.issueConfig.dialogConfig.isShow === true) {
        this.$refs.formComponent1.isValidate();
        const flag = this.$refs.formComponent1.flag;
        let flag1 = false;
        const performanceUnit = [];
        if (this.cydwList.length > 0) {
          try {
            this.cydwList.forEach((item, index) => {
              if (this.$refs[item.ref][0].form.unit && this.$refs[item.ref][0].form.receiver) {
                performanceUnit.push({
                  unit: this.$refs[item.ref][0].form.unit,
                  unitId: this.$refs[item.ref][0].form.unitId,
                  receiver: this.$refs[item.ref][0].form.receiver,
                  receiverId: this.$refs[item.ref][0].form.receiverId
                });
                flag1 = true;
              } else {
                this.$message({
                  message: `请选择参演单位${index + 1}的接收人！`,
                  type: "error"
                });
                flag1 = false;
                throw new Error(`请选择接收人！`);
              }
            });
          } catch (error) {
            console.log(error);
          }
        }
        if (flag && flag1) {
          const form = this.$refs.formComponent1.form;
          // form.drillStartTime = form.drillStartTime;
          // form.drillEndTime = form.drillEndTime;
          if (this.$refs.formComponent1.fileList.length > 0) {
            const drillScript = {
              attach_name: this.$refs.formComponent1.fileList[0].name,
              attach_id: this.$refs.formComponent1.fileList[0].attachId
            };
            form.drillScript = JSON.stringify(drillScript);
          }
          let parmas = {
            drillNoticeSubDetailVo: this.$refs.formComponent1.form,
            creator: this.$refs.tbxx.form.fillUser,
            creatorUnit: this.$refs.tbxx.form.fillUserDept,
            createTime: this.$refs.tbxx.form.fillTime,
            performanceUnit: performanceUnit || null,
            id: this.id
          };
          if (!type) {
            monthPlanXfSave(parmas).then(res => {
              if (res) {
                this.$message({
                  message: "保存成功！",
                  type: "success"
                });
                this.config.issueConfig.dialogConfig.isShow = false;
                this.getList();
              }
            });
          } else if (type === "handleIssue") {
            flowObj.taskId = "task3";
            flowObj.idea = "1";
            flowObj.ideaMsg = "";
            const nextAssigneeList = await handleGetNextUsers(flowObj);
            parmas = { ...parmas, ...flowObj, nextAssigneeList };
            monthPlanXfSubmit(parmas).then(res => {
              if (res) {
                this.$message({
                  message: "提交成功！",
                  type: "success"
                });
                this.config.issueConfig.dialogConfig.isShow = false;
                this.getList();
              }
            });
          } else if (["agree", "reject"].includes(type)) {
            if (type === "agree") {
              parmas.approvalSign = "pass";
              flowObj.idea = "1";
              flowObj.ideaMsg = "同意";
            } else {
              parmas.approvalSign = "reject";
              flowObj.idea = "0";
              flowObj.ideaMsg = "驳回";
            }
            flowObj.taskId = "task4";
            const nextAssigneeList = await handleGetNextUsers(flowObj);
            parmas.approvalOpinion = this.$refs.shxx.form.approvalOpinion;
            parmas.approvalUser = this.$refs.shxx.form.approvalUser;
            parmas.approvalTime = this.$refs.shxx.form.approvalTime;
            parmas.approvalDept = this.$refs.shxx.form.approvalDept;
            parmas.drillNoticeId = this.drillNoticeId;
            parmas = { ...parmas, ...flowObj, nextAssigneeList };
            monthPlanXfApprove(parmas).then(res => {
              if (res) {
                this.$message({
                  message: "审核成功！",
                  type: "success"
                });
                this.config.issueConfig.dialogConfig.isShow = false;
                this.getList();
              }
            });
          }
        }
      } else if (this.config.personnelConfig.dialogConfig.isShow === true) {
        let parmas = {
          id: this.id,
          fillUser: this.userName,
          fillUserDept: this.userDep,
          fillTime: this.time,
          members: this.config.personnelConfig.table.tableData ? JSON.stringify(this.config.personnelConfig.table.tableData) : null,
          actualDrillCount: this.config.personnelConfig.table.tableData ? Number(this.config.personnelConfig.table.tableData.length) : 0
        };

        if (type === "submit") {
          if (this.config.personnelConfig.table.tableData) {
            flowObj.taskId = "task5";
            flowObj.idea = "1";
            flowObj.ideaMsg = "";
            const nextAssigneeList = await handleGetNextUsers(flowObj);
            parmas = { ...parmas, ...flowObj, nextAssigneeList };
            ryxzSbumit(parmas).then(res => {
              if (res) {
                this.$message({
                  message: "提交成功！",
                  type: "success"
                });
                this.config.personnelConfig.dialogConfig.isShow = false;
                this.getList();
              }
            });
          } else {
            this.$message({
              message: "请先选择人员！",
              type: "error"
            });
          }
        } else if (["agree", "reject"].includes(type)) {
          parmas.approvalOpinion = this.$refs.formComponent4.approvalOpinion;
          parmas.approver = this.userName;
          parmas.approvalUnit = this.userDep;
          parmas.approvalTime = this.time;
          if (type === "agree") {
            parmas.approvalSign = "pass";
          } else if (type === "reject") {
            parmas.approvalSign = "reject";
            flowObj.idea = "0";
            flowObj.ideaMsg = "驳回";
            flowObj.taskId = "task6";
            const nextAssigneeList = await handleGetNextUsers(flowObj);
            parmas = { ...parmas, ...flowObj, nextAssigneeList };
          }
          ryxzApproval(parmas).then(res => {
            if (res) {
              this.$message({
                message: "审核成功！",
                type: "success"
              });
              this.config.personnelConfig.dialogConfig.isShow = false;
              this.getList();
            }
          });
        } else if (!type) {
          if (this.config.personnelConfig.table.tableData) {
            ryxzSave(parmas).then(res => {
              if (res) {
                this.$message({
                  message: "保存成功！",
                  type: "success"
                });
                this.config.personnelConfig.dialogConfig.isShow = false;
                this.getList();
              }
            });
          } else {
            this.$message({
              message: "请先选择人员！",
              type: "error"
            });
          }
        }
      } else if (this.config.temporaryDrillAddConfig.dialogConfig.isShow === true) {
        const form = this.$refs.formComponent.form;
        if (this.config.temporaryDrillAddConfig.dialogConfig.type === "add") {
          form.drillUnit = (form.drillUnit).join(",");
          form.drillUnitIds = (form.drillUnitIds).join(",");
        }
        let parmas = {
          // drillTemporarySubSaveDto: this.$refs.formComponent.form,
          ...this.$refs.formComponent.form,
          fillUser: this.userName,
          fillUserDept: this.userDep,
          fillTime: this.time,
          dataType: 2,
          id: this.id
        };
        if (!type) {
          monthPlanDetailSave(parmas).then(res => {
            if (res) {
              this.$message({
                message: "保存成功！",
                type: "success"
              });
              this.config.temporaryDrillAddConfig.dialogConfig.isShow = false;
              this.getList();
            }
          });
        } else if (type === "submit") {
          parmas.id = this.id;
          flowObj.taskId = "task1";
          flowObj.idea = "1";
          flowObj.ideaMsg = "";
          const nextAssigneeList = await handleGetNextUsers(flowObj);
          parmas = { ...parmas, ...flowObj, nextAssigneeList };
          monthPlanDetailSubmit(parmas).then(res => {
            if (res) {
              this.$message({
                message: "提交成功！",
                type: "success"
              });
              this.config.temporaryDrillAddConfig.dialogConfig.isShow = false;
              this.getList();
            }
          });
        } else if (["agree", "reject"].includes(type)) {
          if (type === "agree") {
            parmas.approvalSign = "pass";
            flowObj.idea = "1";
            flowObj.ideaMsg = "同意";
          } else if (type === "reject") {
            parmas.approvalSign = "reject";
            flowObj.idea = "0";
            flowObj.ideaMsg = "驳回";
          }
          flowObj.taskId = "task2";
          const nextAssigneeList = await handleGetNextUsers(flowObj);
          parmas.id = this.id;
          parmas.approvalOpinion = this.$refs.formComponent2.approvalOpinion;
          parmas.approver = this.userName;
          parmas.approvalUnit = this.userDep;
          parmas.approvalTime = this.time;
          parmas = { ...parmas, ...flowObj, nextAssigneeList };
          monthPlanDetailApprove(parmas).then(res => {
            if (res) {
              this.$message({
                message: "审核成功！",
                type: "success"
              });
              this.config.temporaryDrillAddConfig.dialogConfig.isShow = false;
              this.getList();
            }
          });
        }
      }
    },
    // 提交
    submit() {
      this.save("submit");
    },
    // 同意
    agree(type) {
      this.save("agree");
    },
    // 驳回
    reject() {
      this.save("reject");
    },
    // 临时演练新增
    add(scope) {
      this.config.temporaryDrillAddConfig.dialogConfig.isShow = true;
      this.config.temporaryDrillAddConfig.dialogConfig.type = "add";
      const { orgId, orgName } = JSON.parse(sessionStorage.getItem("org"));
      if (scope) {
        this.lsDetail(scope.row.id);
        this.id = scope.row.id;
      } else {
        this.id = "";
        this.$nextTick(() => {
          // this.$refs.formComponent.form = {};
          this.$refs.formComponent.form.drillUnitIds = [];
          // this.$refs.formComponent.form.organisedUnitName = dwbmName;
          // this.$refs.formComponent.form.organisedUnitId = orgId;
          // this.$refs.formComponent.form.drillUnit = [];
          this.$set(this.$refs.formComponent.form, "organisedUnitName", orgName);
          this.$set(this.$refs.formComponent.form, "organisedUnitId", orgId);
          this.$set(this.$refs.formComponent1.form, "fillUser", this.userName);
          this.$set(this.$refs.formComponent1.form, "fillUserDept", this.userDep);
          this.$set(this.$refs.formComponent1.form, "fillTime", this.time);
        });
      }
      this.getInputVal();
    },
    // 临时演练详情
    lsDetail(id) {
      const parmas = {
        id: id
      };
      getMonthById(parmas).then(res => {
        const form = res.drillMonthlySubDetailVo;
        form.drillUnit = (form.drillUnit).split(",");
        form.drillUnitIds = (form.drillUnitIds).split(",");
        this.$refs.formComponent.form = res.drillMonthlySubDetailVo;
        if (this.config.temporaryDrillAddConfig.dialogConfig.type === "audit") {
          this.$refs.formComponent.form.drillUnit = this.$refs.formComponent.form.drillUnit.join(",");
          this.$refs.formComponent.form.drillUnitIds = this.$refs.formComponent.form.drillUnitIds.join(",");
          console.log(this.$refs.formComponent.form, "---this.$refs.formComponent.form ");
        }
        this.$nextTick(() => {
          this.$refs.formComponent.form.associatedDrillId = res.yearlyDetailVo.id;
          this.$refs.formComponent.form.associatedDrillName = res.yearlyDetailVo.drillProjectName;
          this.$set(this.$refs.formComponent1.form, "fillUser", res.fillUser ? res.fillUser : this.userName);
          this.$set(this.$refs.formComponent1.form, "fillUserDept", res.fillUserDept ? res.fillUserDept : this.userDep);
          this.$set(this.$refs.formComponent1.form, "fillTime", res.fillTime ? res.fillTime : this.time);
        });
      });
    },
    // 临时演练审核
    lsAudit(scope) {
      this.id = scope.row.id;
      this.config.temporaryDrillAddConfig.dialogConfig.isShow = true;
      this.config.temporaryDrillAddConfig.dialogConfig.type = "audit";
      this.config.temporaryDrillAddConfig.formConfig.formData.forEach(item => { item.isDisabled = true; });
      this.config.temporaryDrillAddConfig.formConfig.rules = {};
      this.config.temporaryDrillAddConfig.titleConfig = [
        {
          title: "演练信息",
          name: "1",
          slot: "slot1"
        },
        {
          title: "填报信息",
          name: "2",
          slot: "slot2"
        },
        {
          title: "审核信息",
          name: "3",
          slot: "slot3"
        }
      ];
      this.config.temporaryDrillAddConfig.dialogConfig.btnList = [
        {
          name: "同意",
          type: "primary",
          id: "agree",
          size: "mini"
        },
        {
          name: "驳回",
          id: "reject",
          size: "mini"
        },
        {
          name: "取消",
          id: "cancel",
          size: "mini"
        }
      ];
      // this.config.temporaryDrillAddConfig.formConfig = {
      //   formData: [
      //     {
      //       type: "input",
      //       label: "演练项目",
      //       prop: "drillProjectName",
      //       class: "half",
      //       lableWidth: "140px"
      //     },
      //     // {
      //     //   type: "select",
      //     //   label: "主办单位",
      //     //   prop: "organisedUnitId",
      //     //   name: "organisedUnitName",
      //     //   class: "half",
      //     //   lableWidth: "140px",
      //     //   option: []
      //     // },
      //     {
      //       type: "selectTree",
      //       label: "主办单位",
      //       prop: "organisedUnitName",
      //       name: "organisedUnitId",
      //       keyWord: "keyWord",
      //       treeRef: "treeRef",
      //       commonClick: true,
      //       clickClose: true,
      //       title: "主办单位选择",
      //       choose: false,
      //       ref: "tree_select",
      //       class: "half",
      //       lableWidth: "140px",
      //       option: [],
      //       treeData: {
      //         data: [],
      //         default: ["1"],
      //         checked: [],
      //         props: {
      //           children: "children",
      //           label: "orgName",
      //           value: "id"
      //         }
      //       }
      //     },
      //     {
      //       type: "select",
      //       label: "演练性质",
      //       dic: "dic_ylxz",
      //       prop: "drillNatureCode",
      //       name: "drillNature",
      //       class: "half",
      //       lableWidth: "140px",
      //       option: []
      //     },
      //     {
      //       type: "select",
      //       label: "演练类型",
      //       dics: "pxyl_lx",
      //       prop: "drillTypeCode",
      //       name: "drillType",
      //       class: "half",
      //       lableWidth: "140px",
      //       option: []
      //     },
      //     {
      //       type: "select",
      //       label: "关联年计划",
      //       prop: "associatedDrillId",
      //       name: "associatedDrillName",
      //       class: "half",
      //       lableWidth: "140px",
      //       option: []
      //     },
      //     {
      //       type: "dataPicker",
      //       label: "计划完成时间",
      //       prop: "planCompleteTime",
      //       class: "half",
      //       dateType: "datetime",
      //       lableWidth: "140px"
      //     },
      //     {
      //       type: "selectTree",
      //       label: "参演单位",
      //       prop: "drillUnit",
      //       name: "drillUnitIds",
      //       keyWord: "keyWord2",
      //       treeRef: "treeRef2",
      //       commonClick: false,
      //       clickClose: false,
      //       title: "人员选择",
      //       choose: true,
      //       ref: "tree_select1",
      //       class: "sjgy",
      //       multiple: true,
      //       lableWidth: "140px",
      //       option: [],
      //       treeData: {
      //         data: [],
      //         default: ["1"],
      //         checked: ["1516830294278176"],
      //         props: {
      //           children: "children",
      //           label: "orgName",
      //           value: "id"
      //         }
      //       }
      //     },
      //     {
      //       type: "textarea",
      //       autosize: true,
      //       label: "主要演练内容",
      //       prop: "drillContent",
      //       class: "sjgy",
      //       lableWidth: "140px"
      //     }
      //   ],
      //   rules: {}
      // };
      this.config.temporaryDrillAddConfig.formConfig2.formData = [
        {
          type: "input",
          label: "审批意见",
          prop: "approvalOpinion",
          class: "sjgy",
          lableWidth: "140px",
          isDisabled: false
        },
        {
          type: "input",
          label: "审批人",
          prop: "approvalUser",
          class: "third",
          lableWidth: "140px",
          isDisabled: true

        },
        {
          type: "input",
          label: "单位及部门",
          prop: "approvalDept",
          class: "third",
          lableWidth: "140px",
          isDisabled: true
        },
        {
          type: "input",
          label: "审批时间",
          prop: "approvalTime",
          class: "third",
          lableWidth: "140px",
          isDisabled: true
        }
      ];
      this.$nextTick(() => {
        this.$set(this.$refs.formComponent2.form, "approvalUser", this.userName);
        this.$set(this.$refs.formComponent2.form, "approvalDept", this.userDep);
        this.$set(this.$refs.formComponent2.form, "approvalTime", this.time);
      });
      this.lsDetail(scope.row.id);
      this.getInputVal();
    },
    // 列表删除
    handleDelete(scope) {
      this.$confirm("此操作将永久删除该条数据, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        this.config.table.tableData.splice(scope.$index, 1);
        // deleteTask({ id: scope.row.id }).then(data => {
        //   if (data) {
        this.$message({
          message: "删除成功",
          type: "success"
        });
        //     this.getList();
        //   }
        // });
      }).catch(() => {
        this.$message({
          type: "info",
          message: "已取消删除"
        });
      });
    },
    // 审核
    audit(scope) {
      this.id = scope.row.id;
      this.config.monthConfig.dialogConfig.isShow = true;
      this.config.monthConfig.formConfig1.formData.forEach((item) => { item.isDisabled = true; });
      this.config.monthConfig.dialogConfig.type = "audit";
      this.config.monthConfig.dialogConfig.title = "演练计划";
      this.config.monthConfig.dialogConfig.btnList = [
        {
          name: "同意",
          type: "primary",
          id: "agree",
          size: "mini"
        },
        {
          name: "驳回",
          id: "reject",
          size: "mini"
        },
        {
          name: "取消",
          id: "cancel",
          size: "mini"
        }
      ];
      this.config.monthConfig.titleConfig = [
        {
          title: "年度演练信息",
          name: "1",
          slot: "slot1"
        },
        {
          title: "月度演练信息",
          name: "2",
          slot: "slot2"
        },
        {
          title: "填报信息",
          name: "3",
          slot: "slot3"
        },
        {
          title: "审批信息",
          name: "4",
          slot: "slot4"
        }
      ];
      this.config.monthConfig.formConfig3.formData = [
        {
          type: "input",
          label: "审批意见",
          prop: "approvalOpinion",
          class: "sjgy",
          lableWidth: "140px",
          isDisabled: false
        },
        {
          type: "input",
          label: "审批人",
          prop: "approvalUser",
          class: "third",
          lableWidth: "140px",
          isDisabled: true

        },
        {
          type: "input",
          label: "单位及部门",
          prop: "approvalDept",
          class: "third",
          lableWidth: "140px",
          isDisabled: true
        },
        {
          type: "input",
          label: "审批时间",
          prop: "approvalTime",
          class: "third",
          lableWidth: "140px",
          isDisabled: true
        }
      ];
      this.config.monthConfig.formConfig1.rules = {};
      this.$nextTick(() => {
        this.$set(this.$refs.formComponent2.form, "fillUser", this.userName);
        this.$set(this.$refs.formComponent2.form, "fillUserDept", this.userDep);
        this.$set(this.$refs.formComponent2.form, "fillTime", this.time);
        this.$set(this.$refs.formComponent3.form, "approvalUser", this.userName);
        this.$set(this.$refs.formComponent3.form, "approvalDept", this.userDep);
        this.$set(this.$refs.formComponent3.form, "approvalTime", this.time);
      });
      this.getMonthPlanDetail(scope.row.id);
      this.getInputVal();
    },
    // 下发通知
    issue(scope) {
      this.id = scope.row.id;
      this.config.issueConfig.dialogConfig.isShow = true;
      this.config.issueConfig.dialogConfig.type = "edit";
      this.getXfDetail(scope.row.id);
      this.getUser();
    },
    // 下发通知详情
    getXfDetail(val) {
      const parmas = {
        id: val
      };
      getMonthXfDetail(parmas).then(res => {
        this.drillNoticeId = res.drillNoticeSubDetailVo.id;
        this.$refs.formComponent.form = res.drillMonthlySubDetailVo;
        if (res.drillNoticeSubDetailVo !== null) {
          if (res.drillNoticeSubDetailVo.drillScript !== null) {
            const fileList = JSON.parse(res.drillNoticeSubDetailVo.drillScript);
            console.log(fileList);
            this.$refs.formComponent1.fileList = [{
              name: fileList.attach_name,
              attach_id: fileList.attach_id
            }];
            console.log(this.$refs.formComponent1.fileList, "??this.$refs.formComponent.fileList");
            this.fileListName2 = fileList.attach_name;
          }
          this.$refs.formComponent1.form = res.drillNoticeSubDetailVo || {};
        }
        this.$nextTick(() => {
          this.$set(this.$refs.tbxx.form, "fillUser", res.fillUser ? res.fillUser : this.userName);
          this.$set(this.$refs.tbxx.form, "fillUserDept", res.fillUserDept ? res.fillUserDept : this.userDep);
          this.$set(this.$refs.tbxx.form, "fillTime", res.fillTime ? res.fillTime : this.time);
          // this.$set(this.$refs.shxx.form, "approvalUser", this.userName);
          // this.$set(this.$refs.shxx.form, "approvalDept", this.userDep);
          // this.$set(this.$refs.shxx.form, "approvalTime", this.time);
        });
        console.log(this.$refs.tbxx.form, "????this.$refs.tbxx.form");
        this.checkIssueConfig(res.performanceUnit, res);
      });
    },
    // 动态加载参演单位
    checkIssueConfig(list, res) {
      if (list.length > 0) {
        list.forEach((item, i) => {
          if (this.config.issueConfig.dialogConfig.type === "edit") {
            this.config.issueConfig[`formConfig${i + 2}`] = {
              formData: [
                {
                  type: "input",
                  label: `参演单位${i + 1}`,
                  prop: "unit",
                  class: "half",
                  lableWidth: "150px",
                  isDisabled: true
                },
                {
                  type: "select",
                  label: "接收人",
                  prop: "receiverId",
                  name: "receiver",
                  class: "half",
                  lableWidth: "150px",
                  option: []
                }
              ]
            };
          } else {
            this.config.issueConfig[`formConfig${i + 2}`] = {
              formData: [
                {
                  type: "input",
                  label: `参演单位${i + 1}`,
                  prop: "unit",
                  class: "half",
                  lableWidth: "150px",
                  isDisabled: true
                },
                {
                  type: "select",
                  label: "接收人",
                  prop: "receiverId",
                  name: "receiver",
                  class: "half",
                  isDisabled: true,
                  lableWidth: "150px",
                  option: []
                }
              ]
            };
          }
          this.cydwList.push({
            ref: `formComponent${i + 2}`,
            formConfig: this.config.issueConfig[`formConfig${i + 2}`]
          });
          this.$nextTick(() => {
            this.$set(this.$refs[`formComponent${i + 2}`][0].form, "unit", list[i].unit || "");
            this.$set(this.$refs[`formComponent${i + 2}`][0].form, "unitId", list[i].unitId || "");
            this.$set(this.$refs[`formComponent${i + 2}`][0].form, "receiverId", list[i].receiverId || "");
            this.$set(this.$refs[`formComponent${i + 2}`][0].form, "receiver", list[i].receiver || "");
            this.config.issueConfig[`formConfig${i + 2}`].formData.forEach(j => {
              if (j.label === "接收人") {
                const parmas = {
                  orgId: this.$refs[`formComponent${i + 2}`][0].form.unitId
                };
                getAccountByOrg(this.common.convertFormData(parmas)).then(res => {
                  const option = res.map((item) => {
                    return {
                      label: `${item.realName}(${item.phone})`,
                      value: item.userId
                    };
                  });
                  j.option = option;
                });
              }
            });
          });
        });
      }
    },
    // 下发通知-下发
    handleIssue() {
      this.save("handleIssue");
    },
    // 下发通知审核
    issueAudit(scope) {
      this.id = scope.row.id;
      this.config.issueConfig.dialogConfig.isShow = true;
      this.config.issueConfig.dialogConfig.type = "audit";
      this.config.issueConfig.formConfig1.formData.forEach((item) => { item.isDisabled = true; });
      this.config.issueConfig.titleConfig = [
        {
          title: "基本信息",
          name: "1",
          slot: "slot1"
        },
        {
          title: "通知信息",
          name: "2",
          slot: "slot2"
        },
        {
          title: "参演单位",
          name: "3",
          slot: "slot3"
        },
        {
          title: "填报信息",
          name: "4",
          slot: "slot4"
        },
        {
          title: "审批信息",
          name: "5",
          slot: "slot5"
        }
      ];
      this.config.issueConfig.dialogConfig.btnList = [
        {
          name: "同意",
          type: "primary",
          id: "agree",
          size: "mini"
        },
        {
          name: "驳回",
          id: "reject",
          size: "mini"
        },
        {
          name: "取消",
          id: "cancel",
          size: "mini"
        }
      ];
      this.config.issueConfig.shxxFormConfig.formData = [
        {
          type: "input",
          label: "审批意见",
          prop: "approvalOpinion",
          class: "sjgy",
          lableWidth: "140px",
          isDisabled: false
        },
        {
          type: "input",
          label: "审批人",
          prop: "approvalUser",
          class: "third",
          lableWidth: "140px",
          isDisabled: true

        },
        {
          type: "input",
          label: "单位及部门",
          prop: "approvalDept",
          class: "third",
          lableWidth: "140px",
          isDisabled: true
        },
        {
          type: "input",
          label: "审批时间",
          prop: "approvalTime",
          class: "third",
          lableWidth: "140px",
          isDisabled: true
        }
      ];
      this.config.issueConfig.formConfig1.rules = {};
      this.$nextTick(() => {
        this.$set(this.$refs.shxx.form, "approvalUser", this.userName);
        this.$set(this.$refs.shxx.form, "approvalDept", this.userDep);
        this.$set(this.$refs.shxx.form, "approvalTime", this.time);
      });
      this.getXfDetail(scope.row.id);
      this.getUser();
    },
    // 人员上报
    report(scope) {
      this.id = scope.row.cpUnitId;
      this.config.personnelConfig.dialogConfig.isShow = true;
      this.reportDetail(scope.row.cpUnitId);
    },
    // 人员上报详情
    reportDetail(id) {
      const parmas = {
        id: id
      };
      ryxzDetail(parmas).then(res => {
        this.$refs.formComponent.form = res.drillMonthlySubDetailVo;
        this.$refs.formComponent1.form = res.drillNoticeSubDetailVo;
        this.$refs.formComponent1.form.ylxz = `${res.drillNoticeSubDetailVo.drillStartTime}至${res.drillNoticeSubDetailVo.drillEndTime}`;
        this.config.personnelConfig.table.tableData = JSON.parse(res.members);
        this.$nextTick(() => {
          this.$set(this.$refs.formComponent3.form, "fillUser", res.fillUser || this.userName);
          this.$set(this.$refs.formComponent3.form, "fillUserDept", res.fillUserDept || this.userDep);
          this.$set(this.$refs.formComponent3.form, "fillTime", res.fillTime || this.time);
        });
      });
    },
    // 人员上报审核
    reportAudit(scope) {
      this.id = scope.row.cpUnitId;
      this.config.personnelConfig.dialogConfig.isShow = true;
      this.config.personnelConfig.formConfig1.formData.forEach((item) => { item.isDisabled = true; });
      this.config.personnelConfig.titleConfig = [
        {
          title: "基本信息",
          name: "1",
          slot: "slot1"
        },
        {
          title: "通知信息",
          name: "2",
          slot: "slot2"
        },
        {
          title: "参演人员",
          name: "3",
          slot: "slot3"
        },
        {
          title: "填报信息",
          name: "4",
          slot: "slot4"
        },
        {
          title: "审批信息",
          name: "5",
          slot: "slot5"
        }
      ];
      this.config.personnelConfig.dialogConfig.btnList = [
        {
          name: "同意",
          type: "primary",
          id: "agree",
          size: "mini"
        },
        {
          name: "驳回",
          id: "reject",
          size: "mini"
        },
        {
          name: "取消",
          id: "cancel",
          size: "mini"
        }
      ];
      this.config.personnelConfig.formConfig4.formData = [
        {
          type: "input",
          label: "审批意见",
          prop: "approvalOpinion",
          class: "sjgy",
          lableWidth: "140px",
          isDisabled: false
        },
        {
          type: "input",
          label: "审批人",
          prop: "approvalUser",
          class: "third",
          lableWidth: "140px",
          isDisabled: true

        },
        {
          type: "input",
          label: "单位及部门",
          prop: "approvalDept",
          class: "third",
          lableWidth: "140px",
          isDisabled: true
        },
        {
          type: "input",
          label: "审批时间",
          prop: "approvalTime",
          class: "third",
          lableWidth: "140px",
          isDisabled: true
        }
      ];
      this.$nextTick(() => {
        this.$set(this.$refs.formComponent4.form, "approvalUser", this.userName);
        this.$set(this.$refs.formComponent4.form, "approvalDept", this.userDep);
        this.$set(this.$refs.formComponent4.form, "approvalTime", this.time);
      });
      this.reportDetail(scope.row.cpUnitId);
    },
    // 人员选择
    getResourcesData() {
      this.config.ChooseConfig.isShow = true;
      this.config.ChooseConfig.unit = "名人员";
      this.getPlayerList();
    },
    // 获取队员列表
    getPlayerList(select, val, item) {
      this.config.PersonnelFormConfig.formData.forEach((s) => {
        if (s.dic === "memberMajor") {
          dicList({ code: "yz_ry_ryzy" }).then(res => {
            const option = res.map((val) => {
              return {
                label: val.dicName,
                value: val.id
              };
            });
            s.option = option;
          });
        } else if (s.dic === "memberType") {
          dicList({ code: "yz_ry_ryxz" }).then(res => {
            const option = res.map((val) => {
              return {
                label: val.dicName,
                value: val.dicName
              };
            });
            s.option = option;
          });
        }
        if (s.name === "accessUnitId") {
          // GetOrgTree().then(res => {
          //   console.log(res, "res");
          //   s.treeData.data = res;
          // });
          getOrgDepartmentList({ orgId: JSON.parse(sessionStorage.getItem("org")).orgId }).then(data => {
            s.treeData.data = data;
          });
        }
      });
      let parmas = {
        pageNum: this.config.PersonnelTableConfig.paginationAtrrs["current-page"],
        pageSize: 100,
        teamId: "",
        occupation: "",
        accessUnitId: JSON.parse(sessionStorage.getItem("org")).orgId
      };
      if (val && !item) {
        parmas = {
          pageNum: this.config.PersonnelTableConfig.paginationAtrrs["current-page"],
          pageSize: 100,
          teamId: "",
          ...val
        };
      } else if (item) {
        parmas = item;
      }
      // const result = this.config.tasking.table.tableData[this.ChooseConfig.index].choiceMemberId || [];
      parmas.occupation = "";
      getMemberss(parmas).then(data => {
        console.log(data.data, "data.datadata.data");
        this.config.PersonnelTableConfig.tableData = data.data;
        this.config.PersonnelTableConfig.paginationAtrrs.total = data.total;
      });
      // GetTeamMember(parmas).then(data => {
      //   console.log(data, "??????data");
      //   this.config.PersonnelTableConfig.tableData = data.data;
      //   this.config.PersonnelTableConfig.paginationAtrrs.total = data.total;
      //   // 根据选择数据进行表格回显
      //   // if (result.length > 0) {
      //   //   this.$nextTick(() => {
      //   //     this.$refs.dialogChoose.$refs.playerTabel.toggleSelection(result);
      //   //   });
      //   // }
      // });
    },
    checkSelect(val, selection) {
      this.$refs.dialogChoose.selection = val;
    },
    // 人员选择弹窗分页
    handleChooseChange(select, item, val) {
      console.log();
      const data = {
        pageNum: val["current-page"],
        pageSize: val["page-size"],
        ...item
      };
      this.getPlayerList(select, item, data);
    },
    // 弹窗选人组件筛选
    chooseQuery(select, val, item) {
      this.getPlayerList(select, val, item);
    },
    // 人员选择点击确认
    teamAdd(item, selecetion) {
      console.log(item, "???????item");
      console.log(selecetion, "???????selecetion");
      this.config.personnelConfig.table.tableData = selecetion;
      this.config.ChooseConfig.isShow = false;
    },
    actionHandle(item, scope) {
      if (item === "编辑") {
        if (["1", "4"].includes(scope.row.flowCode)) {
          if (this.$route.query.type === "temporaryPlan") {
            this.add(scope);
          } else if (this.$route.query.type === "monthPlan") {
            this.edit(scope);
          }
        } else if (scope.row.flowCode === "44") {
          this.issue(scope);
        } else if (scope.row.flowCode === "15") {
          this.report(scope);
        }
      } else if (item === "审核") {
        if (scope.row.flowCode === "2") {
          if (this.$route.query.type === "temporaryPlan") {
            this.lsAudit(scope);
          } else {
            this.audit(scope);
          }
        } else if (scope.row.flowCode === "13") {
          this.reportAudit(scope);
        }
      } else if (item === "通知审核") {
        this.issueAudit(scope);
      } else if (item === "删除") {
        this.handleDelete(scope);
      } else if (item === "下发通知") {
        this.issue(scope);
      } else if (item === "人员上报") {
        this.report(scope);
      } else if (item === "上传结果") {
        this.uploadResults(scope.row.id, "attachResultInfo");
        // attachResultInfo
      } else if (item === "方案脚本") {
        this.uploadResults(scope.row.id, "scenarioScriptFile");
        // scenarioScriptFile
      } else if (item === "查看脚本") {
        this.TrainingDetails(scope.row.scenarioScriptFile);
      } else if (item === "查看结果") {
        this.TrainingDetails(scope.row.attachResultInfo);
      }
    },
    // 调用按钮对应方法
    onActionClick(item, index) {
      this[item.id]();
    },
    handleSizeChange(val) {
      const parmas = {
        pageNum: val["current-page"],
        pageSize: val["page-size"],
        orgId: JSON.parse(sessionStorage.getItem("org")).orgId,
        ...this.form
      };
      this.getList(parmas);
    },
    // 弹窗关闭事件
    close(val) {
      val.isShow = false;
      val.type = "";
      this.cydwList = [];
      if (this.$route.query.type === "yearsPlan") {
        this.config.yearsImportConfig.table.tableData = [];
        this.$refs.formComponent.fileList = [];
        this.$refs.formComponent1.fileList = [];
        this.fileListName = "";
        this.fileListName1 = "";
      } else if (this.$route.query.type === "temporaryPlan") {
        if (this.config.temporaryDrillAddConfig.dialogConfig.isShow === true) {
          this.config.temporaryDrillAddConfig.formConfig2.formData = [];
          this.$refs.formComponent.form = {};
        }
      }
    },
    closeTemporary(val) {
      if (val.title == "临时演练计划") {
        // config.temporaryDrillAddConfig.dialogConfig
        this.$nextTick(() => {
          this.$refs.formComponent.form = {};
          this.$refs.formComponent1.form = {};
          // this.$refs.formComponent2.form = {};
        });
        // this.$refs.formComponent.fileList = {};
        // this.$refs.formComponent1.fileList = {};
        // this.$refs.formComponent2.fileList = {};
        // this.config.temporaryDrillAddConfig.formConfig2.formData = [];
      }
    },
    // 弹窗取消按钮
    cancel() {
      this.config.dialogConfig.isShow = false;
    },
    pick(accept, multiple) {
      return new Promise(function (resolve, reject) {
        const input = document.createElement("input");
        accept = accept ? accept.trim() : "";
        input.type = "file";
        input.multiple = multiple;
        let count = 0;
        function hasSelectedFile() {
          if (input.value !== "") {
            resolve(multiple ? Array.from(input.files) : input.files[0]);
          } else if (++count >= 40) {
            reject("pick cancel");
          } else {
            setTimeout(hasSelectedFile, 50);
          }
        }
        function focus() {
          window.removeEventListener("focus", focus);
          hasSelectedFile();
        }
        window.addEventListener("focus", focus);
        input.onchange = focus;
        input.accept = accept;
        input.click();
      });
    },
    // 上传结果/方案脚本
    async uploadResults(id, types) {
      try {
        let file = await this.pick(".pdf,.jpg,.png,.pdf,.doc", true);
        const maxFileSize = 20 * 1024 * 1024;
        let flag = true;
        if (file[0].fileSize > maxFileSize) {
          this.$message({
            message: "上传文件大小不得大于20MB!",
            type: "error"
          });
          file = [];
          flag = false;
        }
        if (flag) {
          const parmas = {
            file: file[0],
            directoryId: 0,
            isNew: true,
            moduleName: "plan_training"
          };
          UploadFile(this.common.convertFormData(parmas)).then(data => {
            const attachInfo = [
              {
                attachName: data.fileName,
                attachId: data.id
              }
            ];
            monthPlanXfUpdate({ id: id, [types]: JSON.stringify(attachInfo) }).then(res => {
              if (res) {
                this.$message({
                  message: "上传成功",
                  type: "success"
                });
                this.getList();
              } else {
                this.$message({
                  message: "文件格式不对",
                  type: "error"
                });
              }
            });
          });
        }
      } catch (error) {
        console.log(error);
      }
    },
    // 年计划查看附件
    CheckFj(row) {
      const loading = this.$loading({
        lock: true,
        text: "Loading",
        spinner: "el-icon-loading",
        background: "rgba(0, 0, 0, 0.6)"
      });
      const datas = JSON.parse(row.attachInfo1);
      loadFile({ id: datas.attach_id }).then(res => {
        const a = document.createElement("a");
        const objectUrl = URL.createObjectURL(res);
        a.setAttribute("href", objectUrl);
        a.setAttribute("download", datas.attach_name);
        a.click();
        loading.close();
      });
    },
    // 月计划查看上传结果和脚本
    TrainingDetails(file) {
      const loading = this.$loading({
        lock: true,
        text: "Loading",
        spinner: "el-icon-loading",
        background: "rgba(0, 0, 0, 0.6)"
      });
      const datas = JSON.parse(file);
      loadFile({ id: datas[0].attachId }).then(res => {
        const a = document.createElement("a");
        const objectUrl = URL.createObjectURL(res);
        a.setAttribute("href", objectUrl);
        a.setAttribute("download", datas[0].attachName);
        a.click();
        loading.close();
      });
    }
  }
};
</script>

<style lang="less" scoped>
@import "../../../assets/style/common.less";
@import "../../../assets/style/ComponentStyle.less";
@import "../../../assets/style/pop-upNotification.less";

:deep(.el-breadcrumb__inner.is-link) {
  font-weight: 100;
  color: #fff;
}

.EmergencyList :deep(.el-breadcrumb__item:last-child .el-breadcrumb__inner) {
  color: #3270ff;
}

.box {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: 15px;
  background-color: #fff;
  border-radius: 4px;
  padding: 10px;
  box-sizing: border-box;
}

.yqwcsj {
  :deep(.el-date-editor.el-input, .el-date-editor.el-input__inner) {
    width: auto;
  }
}

.yuandian1 {
  display: inline-block;
  background-color: #ccc;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.ydBgcolor {
  background-color: #246dfd;
  box-shadow: 0px 0px 8px 0px rgb(10, 99, 241);
}

:deep(.el-step__icon.is-text) {
  border: none;
}

:deep(.el-step__title.is-process) {
  font-weight: normal;
}

:deep(.el-upload) {
  width: 100%;
}

.upload {
  width: 100%;
  display: flex;
  align-items: center;

  :deep(.el-input__inner) {
    width: 98%;
  }

  :deep(.el-button) {
    padding: 9px 15px !important;
  }
}

.underLine {
  width: 100%;
  display: flex;
  align-items: center;

  :deep(.el-input__inner) {
    width: 100%;
    cursor: pointer;

    &::placeholder {
      color: #5077ff;
      text-decoration: underline;
      font-size: 16px;
    }
  }
}

.uploadBox {
  :deep(.el-upload-list) {
    display: none;
  }
}

.uploadStyle {
  :deep(.el-input__inner) {
    color: #5077ff;
    text-decoration: underline;
    cursor: pointer;
  }
}

.temporaryPlan :deep(.el-dialog) {
  height: 60% !important;
}

.chooseMember:deep(.el-dialog) {
  height: 55vh !important;
}

.Download {
  font-size: 17px;
  text-align: right;
  vertical-align: middle;
  float: left;
  color: #606266;
  line-height: 40px;
  padding: 0 12px 0 0;
  box-sizing: border-box;
  margin-left: 70px;
}

.Downloads {
  font-size: 17px;
  text-align: right;
  vertical-align: middle;
  float: left;
  color: #3561fd;
  cursor: pointer;
  text-decoration: underline;
  line-height: 40px;
  padding: 0 12px 0 0;
  box-sizing: border-box;
  margin-left: 10px;
}
</style>
